package API.File.Practise.Test;

public class TestGetFileType {
    public static void main(String[] args) {
        System.out.println(getFileType("Welcome.txt"));
    }

    public static String getFileType(String fileName) {
        String[] params = fileName.split("\\.");
        if(params.length >= 2) {
            return params[params.length - 1];
        } else {
            return null;
        }
    }
}
